package com.itheima.StringBuilder;

public class Demo2 {
    public static void main(String[] args) {
        //创建一个StringBuilder对象,初始值位"红色"
        StringBuilder sb = new StringBuilder("红色");
        //往StringBuilder对象sb里添加蓝色,绿色
        sb.append("蓝色").append("绿色");
        sb.reverse();
        int length = sb.length();
        System.out.println("length="+length);

        System.out.println("sb"+sb);

        String s = sb.toString();
        System.out.println("s="+s);

    }
}
